/**
 * MenuFrame.java
 * Dimiourgi ti MenuBar meta MenuItems.
 */

package GUI;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;

public class MenuFrame extends JFrame{
    private JDesktopPane theDesktop;
    /**
     * Methodos dimiourgias horis orismata pou orizi to GUI Menu.
     */
    public MenuFrame(){
        super("Multiplay Chess Game.");
        JMenuBar bar = new JMenuBar();
        JMenu fileMenu = new JMenu("File");
        JMenuItem newItem = new JMenuItem("New");
        JMenuItem saveItem = new JMenuItem("Save");
        JMenuItem loadItem = new JMenuItem("Load");
        
        fileMenu.add(newItem);
        bar.add(fileMenu);
        setJMenuBar( bar );
        theDesktop = new JDesktopPane();
        add(theDesktop);
        newItem.addActionListener(
                    new ActionListener(){
                        public void actionPerformed(ActionEvent event) {
                            JOptionPane.showMessageDialog(MenuFrame.this, "New");
                            //TODO Edo tha bi ti tha kani to
                        }
                    }
                ); // Telos newItem.
                
        fileMenu.add(saveItem);
        bar.add(fileMenu);
        setJMenuBar( bar );
        add(theDesktop);
        saveItem.addActionListener(
                    new ActionListener(){
                        public void actionPerformed(ActionEvent event) {
                            JOptionPane.showMessageDialog(MenuFrame.this, "Save");
                            //TODO Edo tha bi ti tha kani to
                        }
                    }
                ); // Telos saveItem.

        fileMenu.add(loadItem);
        bar.add(fileMenu);
        setJMenuBar( bar );
        add(theDesktop);
        loadItem.addActionListener(
                    new ActionListener(){
                        public void actionPerformed(ActionEvent event) {
                            JOptionPane.showMessageDialog(MenuFrame.this, "Load");
                            //TODO Edo tha bi ti tha kani to
                        }
                    }
                ); // Telos loadItem.
                
       //===============================
        JMenu editMenu = new JMenu("Edit");
        JMenuItem previousItem = new JMenuItem("Previous");
        JMenuItem nextItem = new JMenuItem("Next");
        
        editMenu.add(previousItem);
        bar.add(editMenu);
        setJMenuBar( bar );
        add(theDesktop);
        previousItem.addActionListener(
                    new ActionListener(){
                        public void actionPerformed(ActionEvent event) {
                            JOptionPane.showMessageDialog(MenuFrame.this, "Previous");
                            //TODO Edo tha bi ti tha kani to
                        }
                    }
                ); // Telos previousItem.

        editMenu.add(nextItem);
        bar.add(editMenu);
        setJMenuBar( bar );
        add(theDesktop);
        nextItem.addActionListener(
                    new ActionListener(){
                        public void actionPerformed(ActionEvent event) {
                            JOptionPane.showMessageDialog(MenuFrame.this, "Next");
                            //TODO Edo tha bi ti tha kani to
                        }
                    }
                ); // Telos nextItem.
    
    JMenu settingsMenu = new JMenu("Settings");
    JMenuItem proposedItem = new JMenuItem("Proposed");
    
    settingsMenu.add(proposedItem);
        bar.add(settingsMenu);
        setJMenuBar( bar );
        add(theDesktop);
        proposedItem.addActionListener(
                    new ActionListener(){
                        public void actionPerformed(ActionEvent event) {
                            JOptionPane.showMessageDialog(MenuFrame.this, "Proposed");
                            //TODO Edo tha bi ti tha kani to
                        }
                    }
                ); // Telos proposedItem.
    
    }//Telos MenuFrame Constractor.
}